<?php
@header("Content-type:text/html;charset=GB2312");
defined('BASEPATH') OR exit('No direct script access allowed');

class Soft extends CI_Controller
{
    function index(){
        $my = $this->load->database('default', TRUE);
        $ms = $this->load->database('sqlserver', TRUE);

        $size = 500;
        $page = isset($_GET['page']) ? $_GET['page'] : 1;
        $zongshu = $page * $size;

        $sql = "select top $size * from (select top $zongshu  * from NC_SoftList order by SoftID asc) NC_SoftList order by SoftID desc";
        $msq = $ms->query($sql)->result_array();
        $m = array();
        foreach($msq as $v){
            $k = array(
                'SoftID'=> $v['SoftID'],
                'ChannelID'=> $v['ChannelID'],
                'ClassID'=> $v['ClassID'],
                'SpecialID'=> $v['SpecialID'],
                'SoftName'=> $v['SoftName'],
                'SoftVer'=> $v['SoftVer'],
                'subtitle'=> $v['subtitle'],
                'ColorMode'=> $v['ColorMode'],
                'FontMode'=> $v['FontMode'],
                'Related'=> $v['Related'],
                'Content'=> $v['Content'],
                'OuterLinks'=> $v['OuterLinks'],
                'Languages'=> $v['Languages'],
                'SoftType'=> $v['SoftType'],
                'RunSystem'=> $v['RunSystem'],
                'impower'=> $v['impower'],
                'Softsize'=> $v['Softsize'],
                'star'=> $v['star'],
                'HomePage'=> $v['HomePage'],
                'Contact'=> $v['Contact'],
                'Author'=> $v['Author'],
                'Regsite'=> $v['Regsite'],
                'showreg'=> $v['showreg'],
                'username'=> $v['username'],
                'PointNum'=> $v['PointNum'],
                'SoftPrice'=> $v['SoftPrice'],
                'SoftTime'=> $v['SoftTime'],
                'plugin'=> $v['plugin'],
                'isTop'=> $v['isTop'],
                'AllHits'=> $v['AllHits'],
                'DayHits'=> $v['DayHits'],
                'WeekHits'=> $v['WeekHits'],
                'MonthHits'=> $v['MonthHits'],
                'HitsTime'=> $v['HitsTime'],
                'HtmlFileDate'=> $v['HtmlFileDate'],
                'SoftImage'=> $v['SoftImage'],
                'Previewimg'=> $v['Previewimg'],
                'Decode'=> $v['Decode'],
                'isBest'=> $v['isBest'],
                'UserGroup'=> $v['UserGroup'],
                'isUpdate'=> $v['isUpdate'],
                'ErrCode'=> $v['ErrCode'],
                'DownAddress'=> $v['DownAddress'],
                'isAccept'=> $v['isAccept'],
                'ForbidEssay'=> $v['ForbidEssay'],
                'AlphaIndex'=> $v['AlphaIndex'],
                'PauseDown'=> $v['PauseDown'],
                'isxmltext'=> $v['isxmltext'],
                'xmlfilename'=> $v['xmlfilename'],
                'TAGS'=> $v['TAGS'],
                'SoftPhoneImage'=> $v['SoftPhoneImage'],
            );
            $m[] = $k;
        }
        var_dump("<pre>");
        var_dump($m);
    }
}